unit basicIO;

{$mode objfpc}{$H+}

{
  IO mother class, defines the interface and data structures.
}

interface

uses
  Classes, SysUtils, basicio_output, basicio_data, logger;

type
  { TBasicIO }
  TBasicIO = class
    protected
      FData: TIOData;
      FOutput: TIOOutput;
    protected
      procedure CreateOutput; virtual; abstract;
    public
      constructor Create; virtual;
      destructor Destroy; override;
    public
      property Data: TIOData read FData;
      property Output: TIOOutput read FOutput;
    public
      procedure Update; virtual;
      procedure GatherInitiallyInfos; virtual;
  end;

implementation

uses
  SystemManager;

{ TBasicIO }

constructor TBasicIO.Create;
begin
  inherited Create;
  FData  := TIOData.Create;
  CreateOutput; //different for each io system
end;

destructor TBasicIO.Destroy;
begin
  FOutput.Free;
  FData.Free;
  inherited Destroy;
end;

procedure TBasicIO.Update;
begin
  GlobalSystemManager.Log.Log('Updating',TLSS_IO);
end;

procedure TBasicIO.GatherInitiallyInfos;
begin
  GlobalSystemManager.Log.Log('Loading initially infos',TLSS_IO);
end;

end.


